<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
    <title>Document</title>
  
  </head>
  <body>
    <div id="app">
        <h3>bmi健康指数</h3>
        <input type="number" v-model.number="w" placeholder="请输入体重单位kg">
        <input type="number" v-model.number="h" placeholder="请输入身高单位m">
        {{bmi()}}
        {{bmi()}}
        {{bmi()}}
        {{bmi()}}
        {{bmi()}}
        
    </div>
    <script src="./vue.global.js"></script>
    <script>
      const { createApp } = Vue;
      const app = createApp({
        data() {
          return {
            w: 0,
            h: 0
          };
        },
        methods: {
          bmi() {
            return this.w/(this.h*this.h)
          }
        },
      });
      app.mount("#app");
    </script>
  </body>
</html>
